# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html


# useful for handling different item types with a single interface

from components.pipelines.public.mysql_pipeline import MysqlPipeline


class JobsPipeline(MysqlPipeline):
    def process_item(self, item, spider):
        item.pre_to_db()
        update_list = []
        update_list.append(item.to_dict)
        self.update_items(item.table_name, update_list, item.__update_key__)
        return item
